/*
 * @Description: 用户登录-接口
 * @Author: xinqiao lxq1990.0716@qq.com
 * @Date: 2024-04-11
 * @LastEditors: xinqiao lxq1990.0716@qq.com
 * @LastEditTime: 2024-04-24
 */
import { post } from '@/api/request'

/** 用户登录 */
export const requestLogin = (data: AccountLoginTypes.IRequest, config?: IRequestConfig) =>
  post<AccountLoginTypes.IRequest, IBaseResponse<AccountLoginTypes.IResponse>>('/system/ysys-user/account/login/V1', data, config)

/** 用户登出 */
export const requestLoginOut = (data: LoginOutTypes.IRequest) =>
  post<LoginOutTypes.IRequest, IBaseResponse<LoginOutTypes.IResponse>>('/system/ysys-user/account/loginOut/V1', data)

/** 保存基本信息 */
export const requestAuthBasic = (data: AuthBasicTypes.IRequest) =>
  post<AuthBasicTypes.IRequest, IBaseResponse<AuthBasicTypes.IResponse>>('/system/ysys-user/account/wxMini/authBasic/V1', data)

/** 微信小程序授权解绑（舍弃） */
export const requestUnBind = (data: UnBindTypes.IRequest) =>
  post<UnBindTypes.IRequest, IBaseResponse<UnBindTypes.IResponse>>('/system/ysys-user/account/unBind/V1', data)

/** 刷新token接口（舍弃） */
export const requestRefreshToken = (data: RefreshTokenTypes.IRequest) =>
  post<RefreshTokenTypes.IRequest, IBaseResponse<RefreshTokenTypes.IResponse>>('/system/ysys-user/account/refreshToken/V1', data)

/** 获取微信授权手机号 */
export const requestAccountAuthPhone = (data: AccountAuthPhoneTypes.IRequest) =>
  post<AccountAuthPhoneTypes.IRequest, IBaseResponse<AccountAuthPhoneTypes.IResponse>>('/system/ysys-user/account/wxMini/authPhone/V1', data)
